Skip to content

Add sniffs to use FrmAppHelper functions instead of FrmProAppHelper f…#2866

Merged
Crabcyborg merged 1 commit into
masterfrom
add_sniffs_to_prefer_lite_helper_functions_over_pro_wrapper_functions
Jan 22, 2026
Merged

Add sniffs to use FrmAppHelper functions instead of FrmProAppHelper f…#2866
Crabcyborg merged 1 commit into
masterfrom
add_sniffs_to_prefer_lite_helper_functions_over_pro_wrapper_functions

Conversation

@Crabcyborg

@Crabcyborg Crabcyborg commented Jan 22, 2026

Copy link
Copy Markdown
Contributor

…unctions that just call FrmAppHelper

Summary by CodeRabbit

New Features

  • Introduced a new code analysis rule that identifies deprecated helper method calls in your codebase and provides automatic fixes to replace them with recommended alternatives, helping maintain code consistency and best practices.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai

coderabbitai Bot commented Jan 22, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

A new PHP_CodeSniffer sniff class is introduced to detect calls to FrmProAppHelper::icon_by_class and FrmProAppHelper::unserialize_or_decode, suggesting replacement with their FrmAppHelper equivalents. The sniff provides automatic fixing. It is registered in the ruleset configuration file.

Changes

Cohort / File(s) Summary
New sniff implementation
phpcs-sniffs/Formidable/Sniffs/CodeAnalysis/PreferFrmAppHelperSniff.php
New sniff class implementing token-based detection of specific FrmProAppHelper method calls. Provides fixable error handling with automatic replacement of FrmProAppHelper with FrmAppHelper. Includes register() method listening for scope resolution operator tokens and process() method implementing detection and fix logic.
Ruleset configuration
phpcs-sniffs/Formidable/ruleset.xml
Reorders existing rules and introduces new rule Formidable.CodeAnalysis.PreferFrmAppHelper to the Formidable ruleset.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

A sniff so keen to catch the way,
When FrmProAppHelper comes out to play,
The rabbit hops and waves its ears,
"Prefer FrmAppHelper!" the code now hears,
With fixes swift, the path is clear,
No helper chaos shall appear! 🐰✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding a sniff to prefer FrmAppHelper functions over FrmProAppHelper wrapper functions that merely forward calls.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Crabcyborg
Crabcyborg merged commit 417eb6f into master Jan 22, 2026
38 checks passed
@Crabcyborg
Crabcyborg deleted the add_sniffs_to_prefer_lite_helper_functions_over_pro_wrapper_functions branch January 22, 2026 16:54
stephywells pushed a commit that referenced this pull request Apr 4, 2026
…lper_functions_over_pro_wrapper_functions

Add sniffs to use FrmAppHelper functions instead of FrmProAppHelper f…
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant